apiVersion: v1
kind: Namespace
metadata:
  name: {{ServiceName}}-ns

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ServiceName}}
  namespace: {{ServiceName}}-ns
  labels:
    app: {{ServiceName}}
spec:
  replicas: 1
  selector:
    matchLabels:
      app: {{ServiceName}}
  template:
    metadata:
      namespace: {{ServiceName}}-ns
      labels:
        app: {{ServiceName}}
      annotations:
        dapr.io/enabled: "true"
        dapr.io/app-id: "{{ServiceName}}"
        dapr.io/app-port: "{{ServicePort}}"
    spec:
      imagePullSecrets:
      - name: harbor-key
      containers:
      - name: {{ServiceName}}
        image: 192.168.43.95/dapr/{{ServiceName}}:{{tagversion}}
        ports:
        - containerPort: {{ServicePort}}
        imagePullPolicy: Always

---
apiVersion: v1
kind: Service
metadata:
  namespace: {{ServiceName}}-ns
  name: {{ServiceName}}-svc
spec:
  type: NodePort
  selector:
    app: {{ServiceName}}
  ports:
    - port: {{ServicePort}}
      targetPort: {{ServicePort}}
      nodePort: {{NodePort}}
